public class Test  {
    public static void main(String[] args) {
        String str1 = "abcdefgh";
        String str2 = "svfgfh";
        String str3 = new String("abcde");
        System.out.println(str1.equals(str3));
        System.out.println(str1.equals(str2));
        System.out.println("================");
        System.out.println(str1.compareTo(str2));
        System.out.println(str1.compareTo(str3));
        System.out.println("================");
        for (int i = 0; i < str1.length(); i++) {
            System.out.print(str1.charAt(i));
        }
        System.out.println();
        //字符串中'c'字符的下标
        System.out.println(str1.indexOf('c'));
        System.out.println(str1.indexOf('c',3));
        System.out.println(str1.indexOf("de"));
    }
}
